<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<!--/meta 作为公共模版分离出去-->
<title>编辑商家</title>
</head>
<body ng-controller="main">
<article class="page-container">
	<form action="<?php url('business/businessSave')?>" method="post" class="form form-horizontal" id="form-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商家名称：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['name']?>" placeholder="请输入商家名称" id="name" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>地址经度：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['lng']?>" placeholder="请输入地址经度" id="lng" name="lng">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>地址纬度：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['lat']?>" placeholder="请输入地址纬度" id="lat" name="lat">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商家地址：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['location']?>" placeholder="请输入商家地址" id="location" name="location">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>背景图片：</label>
			<div class="formControls col-xs-8 col-sm-10"> <span class="btn-upload form-group">
				<input class="input-text upload-url" type="text" name="background" id="uploadfile" >
				<a href="javascript:;" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
				<input id="file" type="file" multiple name="image[]" class="input-file"  value="">
				</span>
				<img class="mt-15" id="img" src="<?php echo $info['background']?>">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>视频：</label>
			<div class="formControls col-xs-8 col-sm-10">
                <span class="btn-upload form-group">
                    <input type="file" name="file" id="video">
                </span>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商家类型：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<select class="select" name="type_id" id="type_id" size="1">
					<?php foreach($type as $v):?>
					<option value="<?php echo $v['id']?>" <?php if($v['id'] == $info['type_id']) echo 'selected';?>><?php echo $v['name']?></option>
					<?php endforeach; ?>
				</select>
			</div>
		</div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商家描述：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="<?php echo $info['descrip']?>" placeholder="请输入商家描述" id="descrip" name="descrip">
            </div>
        </div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type="hidden" name="id" value="<?php echo $info['id']?>">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/layer.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="/static/admin/js/validate-methods.js"></script>
<script type="text/javascript" src="/static/admin/js/messages_zh.js"></script>
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-add").validate({
		rules:{
			name:{ required:true},
			location:{ required:true},
            type_id:{ required:true},
            descrip:{ required:true},
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			var options = {
				success: function (data) {
					if(data.code==0){
						layer.msg(data.msg,{icon:1,time:1000});
						setInterval("closeWindow()",1000);
					}else{
						layer.msg(data.msg,{icon:5,time:1000});
					}
				}
			};
			$(form).ajaxSubmit(options);
		}
	});
});
function closeWindow() {
	var index = parent.layer.getFrameIndex(window.name);
	window.parent.location.reload();
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>